package com.weixing.mall.provider.controller.front;


import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.provider.model.enums.GoodsPointStatusEnum;
import com.weixing.mall.provider.model.query.GoodsPointQuery;
import com.weixing.mall.provider.service.IGoodsPointService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 前端积分商品模块
 * @author syc
 * @since 2020-05-08
 */
@Api(value = "前端:积分商品",tags = "前端:积分商品")
@RestController
@RequestMapping("front/goodsPoint")
public class FrontGoodsPointController extends BaseController {
    @Autowired
    private IGoodsPointService goodsPointService;

    /**
     * 获取积分商品列表
     */
    @ApiOperation(value = "获取积分商品列表")
    @GetMapping("selectList")
    public Result selectGoodsPoint(){
        GoodsPointQuery gpq = new GoodsPointQuery();
        gpq.setStatus(GoodsPointStatusEnum.STATUS_1);//查询上架状态商品
        return ResultUtil.success(goodsPointService.selectGoodsPointList(initMPage(),gpq));
    }
}
